<!--<!doctype html>-->

<!--<html>-->
<!--<head>-->
<!--<title>五子棋登录</title>-->
<!--<meta name="viewport" content="width=device-width, initial-scale=1">-->
<!--<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />-->
<!--<script type="application/x-javascript">function submit_form() {-->
<!--	console.log("不跳转");-->
<!--	return false;-->
<!--}-->

<!--addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>-->
<!--&lt;!&ndash; font files &ndash;&gt;-->
<!--<link href='//fonts.googleapis.com/css?family=Raleway:400,100,200,300,500,600,700,800,900' rel='stylesheet' type='text/css'>-->
<!--<link href='//fonts.googleapis.com/css?family=Poiret+One' rel='stylesheet' type='text/css'>-->
<!--&lt;!&ndash; /font files &ndash;&gt;-->

<!--</head>-->
<!--<body>-->
<!--<iframe  id="submitFrame" style="display: none;width:0; height:0" name="submitFrame"  src="about:blank"></iframe>-->
<!--<h1>五子棋</h1>-->
<!--<div class="form-w3ls">-->
<!--    <div class="tab-content">-->
<!--        <div id="signin-agile">   -->
<!--			<form action="/login" method="post">-->
<!--				-->
<!--				<p class="header">用户账号</p>-->
<!--				<input type="text" name="userId" value="User Id" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'User Id';}">-->
<!--				-->
<!--				<p class="header">密码</p>-->
<!--				<input type="password" name="password" value="Password" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Password';}">-->
<!--				-->
<!--				<input type="checkbox" id="brand" value="">-->
<!--				<label for="brand"><span></span> 记住我</label>-->
<!--				-->
<!--				<input type="submit" class="sign-in" value="登录">-->

<!--			</form>-->
<!--		</div>-->
<!--		<div id="signup-agile">-->
<!--			<form id="register" action="/regist" method="post" target="submitFrame"  enctype="multipart/form-data" onsubmit="return submitForm()">-->
<!--				>-->
<!--				<p class="header">您的用户账号将自动分配</p>-->


<!--				<p class="header">密码</p>-->
<!--				<input type="password" name="password" value="Password" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Password';}">-->
<!--				-->
<!--				<p class="header">重复密码</p>-->
<!--				<input type="password" name="rpassword" value="Confirm Password" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Confirm Password';}">-->
<!--				-->
<!--				<input type="submit" class="register" value="注册">-->
<!--			</form>-->
<!--			<script>-->

<!--				function submitForm() {-->
<!--					// jquery 表单提交-->
<!--					$("#register").ajaxSubmit(function(message) {-->
<!--						// 对于表单提交成功后处理，message为表单正常提交后返回的内容-->
<!--						console.log(message);-->
<!--					});-->
<!--					return false; // 必须返回false，否则表单会自己再做一次提交操作，并且页面跳转-->
<!--				}-->

<!--			</script>-->
<!--		</div>-->
<!--		<div>-->
<!--			<form action="/review" method="post">-->

<!--				<p class="header">对战ID</p>-->
<!--				<input type="text" name="fightid" value="fightId">-->

<!--				<input type="submit" class="re-view" value="复盘">-->

<!--			</form>-->
<!--		</div>-->
<!--    </div>&lt;!&ndash; tab-content &ndash;&gt;-->
<!--</div>&lt;!&ndash; /form &ndash;&gt;-->
<!--<script src="../js/jquery.min.js"></script>-->
<!--<script src="http://lib.h-ui.net/jquery.form/3.51.0/jquery.form.min.js"></script>-->
<!--</body>-->
<!--</html>-->
<!--<!doctype html>-->
<!--<html  class="x-admin-sm">-->
<!--<head>-->
<!--	<meta charset="UTF-8">-->
<!--	<title>五子棋系统</title>-->
<!--	<meta name="renderer" content="webkit|ie-comp|ie-stand">-->
<!--	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">-->
<!--	<meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />-->
<!--	<meta http-equiv="Cache-Control" content="no-siteapp" />-->
<!--	<link rel="stylesheet" href="/css/font.css">-->
<!--	<link rel="stylesheet" href="/css/login.css">-->
<!--	<link rel="stylesheet" href="/css/xadmin.css">-->
<!--	<script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>-->
<!--	<script src="/lib/layui/layui.js" charset="utf-8"></script>-->
<!--	&lt;!&ndash;[if lt IE 9]>-->
<!--	<script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>-->
<!--	<script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>-->
<!--	<![endif]&ndash;&gt;-->
<!--</head>-->
<!--<body class="login-bg">-->

<!--<div class="login layui-anim layui-anim-up">-->
<!--	<div class="message">五子棋系统</div>-->
<!--	<div id="darkbannerwrap"></div>-->

<!--	<form action="/login" method="post">-->

<!--		<p class="header">用户账号</p>-->
<!--		<input type="text" name="userId">-->

<!--		<p class="header">密码</p>-->
<!--		<input type="password" name="password">-->

<!--		<input type="submit" class="sign-in" value="登录">-->

<!--	</form>-->

<!--	<form id="register" action="/regist" method="post" target="submitFrame"  enctype="multipart/form-data" onsubmit="return submitForm()">-->
<!--		<p class="header">您的用户ID将自动分配</p>-->

<!--		<p class="header">用户名</p>-->
<!--		<input type="text" name="username">-->

<!--		<p class="header">密码</p>-->
<!--		<input type="password" name="password">-->


<!--		<p class="header">重复密码</p>-->
<!--		<input type="password" name="rpassword" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Confirm Password';}">-->

<!--		<input type="submit" class="register" value="注册">-->
<!--	</form>-->

<!--	<button class="layui-btn" onclick="javascript:window.location.href='admin-login.html'"><i class="layui-icon">&#xe612;</i>管理员模式</button>-->

<!--	<script>-->
<!--		&lt;!&ndash;<!doctype html>&ndash;&gt;-->
<!--				-->

		<!---->
	<!--&lt;!&ndash; font files &ndash;&gt;-->
	<!--<link href='//fonts.googleapis.com/css?family=Raleway:400,100,200,300,500,600,700,800,900' rel='stylesheet' type='text/css'>-->
	<!--<link href='//fonts.googleapis.com/css?family=Poiret+One' rel='stylesheet' type='text/css'>-->
	<!--&lt;!&ndash; /font files &ndash;&gt;-->

	<!--</head>-->
	<!--<body>-->
	<!--<iframe  id="submitFrame" style="display: none;width:0; height:0" name="submitFrame"  src="about:blank"></iframe>-->
	<!--<h1>五子棋</h1>-->
	<!--<div class="form-w3ls">-->
	<!--    <div class="tab-content">-->
	<!--        <div id="signin-agile">   -->
	<!--			<form action="/login" method="post">-->
	<!--				-->
	<!--				<p class="header">用户账号</p>-->
	<!--				<input type="text" name="userId" value="User Id" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'User Id';}">-->
	<!--				-->
	<!--				<p class="header">密码</p>-->
	<!--				<input type="password" name="password" value="Password" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Password';}">-->
	<!--				-->
	<!--				<input type="checkbox" id="brand" value="">-->
	<!--				<label for="brand"><span></span> 记住我</label>-->
	<!--				-->
	<!--				<input type="submit" class="sign-in" value="登录">-->

	<!--			</form>-->
	<!--		</div>-->
	<!--		<div id="signup-agile">-->
	<!--			<form id="register" action="/regist" method="post" target="submitFrame"  enctype="multipart/form-data" onsubmit="return submitForm()">-->
	<!--				>-->
	<!--				<p class="header">您的用户账号将自动分配</p>-->


	<!--				<p class="header">密码</p>-->
	<!--				<input type="password" name="password" value="Password" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Password';}">-->
	<!--				-->
	<!--				<p class="header">重复密码</p>-->
	<!--				<input type="password" name="rpassword" value="Confirm Password" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Confirm Password';}">-->
	<!--				-->
	<!--				<input type="submit" class="register" value="注册">-->
	<!--			</form>-->
	<!--			<script>-->

	<!--				function submitForm() {-->
	<!--					// jquery 表单提交-->
	<!--					$("#register").ajaxSubmit(function(message) {-->
	<!--						// 对于表单提交成功后处理，message为表单正常提交后返回的内容-->
	<!--						console.log(message);-->
	<!--					});-->
	<!--					return false; // 必须返回false，否则表单会自己再做一次提交操作，并且页面跳转-->
	<!--				}-->

	<!--			</script>-->
	<!--		</div>-->
	<!--		<div>-->
	<!--			<form action="/review" method="post">-->

	<!--				<p class="header">对战ID</p>-->
	<!--				<input type="text" name="fightid" value="fightId">-->

	<!--				<input type="submit" class="re-view" value="复盘">-->

	<!--			</form>-->
	<!--		</div>-->
	<!--    </div>&lt;!&ndash; tab-content &ndash;&gt;-->
	<!--</div>&lt;!&ndash; /form &ndash;&gt;-->
	<!--<script src="../js/jquery.min.js"></script>-->
	<!--<script src="http://lib.h-ui.net/jquery.form/3.51.0/jquery.form.min.js"></script>-->
	<!--</body>-->
	<!--</html>-->
	<!doctype html>
	<html  class="x-admin-sm">
	<head>
		<meta charset="UTF-8">
		<title>五子棋系统</title>
		<meta name="renderer" content="webkit|ie-comp|ie-stand">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
		<meta http-equiv="Cache-Control" content="no-siteapp" />
		<link rel="stylesheet" href="/css/font.css">
		<link rel="stylesheet" href="/css/login.css">
		<link rel="stylesheet" href="/css/xadmin.css">
		<script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
		<script src="/lib/layui/layui.js" charset="utf-8"></script>
		<!--[if lt IE 9]>
		<script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
		<script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
		<![endif]-->
	</head>
	<body class="login-bg">

	<div class="login layui-anim layui-anim-up">
		<div class="message">五子棋系统</div>
		<div id="darkbannerwrap"></div>

		<form action="/login" method="post">

			<p class="header">用户账号</p>
			<input type="text" name="userId">

			<p class="header">密码</p>
			<input type="password" name="password">

			<input type="submit" class="sign-in" value="管理员登录">

		</form>

		<form class="layui-form">
			<p class="header">您的用户ID将自动分配</p>

			<p class="header">用户名</p>
			<input type="text" name="username" id="username">

			<p class="header">密码</p>
			<input type="password" name="password" id="password">


			<p class="header">重复密码</p>
			<input type="password" name="rpassword" id="rpassword" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Confirm Password';}">

			<div class="layui-form-item">
				<button  class="layui-btn" lay-filter="Regist" lay-submit="">
					注册
				</button>
			</div>
		</form>
	</div>

		<button class="layui-btn" onclick="javascript:window.location.href='admin-login.html'"><i class="layui-icon">&#xe612;</i>管理员模式</button>

		<script>

			layui.use(['form', 'layer'],
					function() {
						$ = layui.jquery;
						var form = layui.form,
								layer = layui.layer;

						form.on('submit(Regist)',
								function(data) {
									var data = {username:$('#username').val(),password:$('#password').val(),rpassword:$('#rpassword').val()};
									console.log(data);
									//发异步，把数据提交给php
									$.ajax({
										url:'/Regist',
										type:'post',
										dataType:'JSON',
										data:data,
										success: function(response){
											console.log(response);
											if (response.id!= 0 ) {
												layer.alert("注册成功,您的ID是：" + response.id, {
															icon: 6
														},
												)
											}else {
												layer.alert("注册失败，两次密码不一致", {
												},
												)
											}
										}
									});

									return false;
								});
					});
			// function submitForm() {
			// 	// jquery 表单提交
			// 	$("#register").ajaxSubmit
			// 	// ajaxSubmit(function(message) {
			// 	// 	// 对于表单提交成功后处理，message为表单正常提交后返回的内容
			// 	// 	console.log(message);
			// 	});
			// 	return false; // 必须返回false，否则表单会自己再做一次提交操作，并且页面跳转
			// }

		</script>
	</div>

	</body>
	</html>